'''
Author: error: git config user.name && git config user.email & please set dead value or install git
Date: 2022-11-11 14:39:45
LastEditors: error: git config user.name && git config user.email & please set dead value or install git
LastEditTime: 2022-11-11 16:52:24
FilePath: \新建文件夹 (2)\冒泡排序.py
Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
'''
def mao_pao(num_list):
    num_len=len(num_list)
    for j in range(num_len):
        sign=False
        for i in range(num_len-1-j):
            if a[i]>a[i+1]:
                a[i],a[i+1]=a[i+1],a[i]
                sign=True
        if not sign:
            break
if __name__=='__main__':
    a=[1,3,4,2,6,9,12,3,22]
    mao_pao(a)
    print(a)